package lzzy14;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class TextStudent {
    public static void main(String[] args) {
        Student stu1 = new Student("1258","大哥","男");
        Student stu2 = new Student("1259","大嫂","女");
        Student stu3 = new Student("1260","二哥","男");
        Map<String ,Student> studentMap=new HashMap<>();
        studentMap.put("2120",stu1);
        studentMap.put("2133",stu3);
        studentMap.put("2142",stu2);
        studentMap.forEach((id,name)-> System.out.println("id="+id + "name="+name));

        System.out.println("学生信息");
        System.out.println("请输入一个学生id：");
        Scanner scan = new Scanner(System.in);
        String id_temp= scan.next();
        if (studentMap.containsKey(id_temp)){
            System.out.println("学生为：");
            System.out.println("id="+id_temp+" "+"信息"+studentMap.get(id_temp));
        }else{
            System.out.println("Not Found 404");
        }
    }
}
